import Vue from "vue";      
import VueRouter from "vue-router";
import NotFound from '../views/NotFound'
import Main from '../views/Main'

import Login from "../views/Login"

Vue.use(VueRouter)
const routes=[
    //主路由
    {
        path:'/',
        component:Main,
        name:'Main',
        redirect:'/home',
        //子路由（嵌套路由）
        children:[
            // {path:'home',name:'home',component:Home},
            // {path:'user',name:'user',component:User},
            // {path:'mall',name:'mall',component:Pagination},
            // {path:'page1',name:'page1',component:PageOne},
            // {path:'page2',name:'page2',component:PageTwo},
           
        ]
    },
    {
        path:'/login',
        name:"login",
        component:Login,
    },
    {
        path: '/404',
        name: 'NotFound',
        component:NotFound,
      },
      {
        path: '*',
        redirect: '/404'
      }
    
]
const router = new VueRouter({
    routes
})
export default router